﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;

namespace RenjianImageViewer.ViewModel.Command
{
    abstract class RenjianCommandBase : ICommand
    {
        protected RenjianViewModel viewModel;

        public RenjianCommandBase(RenjianViewModel viewModel)
        {
            this.viewModel = viewModel;
        }

        abstract public void Execute(object parameter);
        public virtual bool CanExecute(object parameter)
        {
            return true;
        }

        public event EventHandler CanExecuteChanged;
        protected void NotifyCanExecuteChanged()
        {
            var tmp = CanExecuteChanged;
            if (tmp != null)
            {
                tmp(this, EventArgs.Empty);
            }
        }
    }
}
